<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>上传excel</title>
	<script src="./lib/jquery-1.11.3.min.js"></script>
</head>
<body>
	<form id= "uploadForm">  
      <p > <input type="hidden" name="promotionMode" value= "3"/></p >  
      <p > <input type="hidden" name="secondLeveCode" value= "301"/></p >  
      <p > <input type="hidden" name="rulesDetail" value= '[{fullMoney: "112", reduceMoney: "12"}]'/></p >  
      <p > <input type="hidden" name="promotionId" value= '900594292869824512'/></p >  
      <p >上传文件： <input type="file" name="file"/></ p>  
      <input type="button" value="上传" id="btn"  />  
	</form>  
	<script>
		$(function() {
			$('#btn').on('click',function() {
				 var formData = new FormData($( "#uploadForm" )[0]);  
				 console.log(formData);
			     $.ajax({  
			          url: 'http://192.168.64.55:9090/api/doPromotionalGoods/bacthImport',  
			          type: 'POST',  
			          data: formData,  
			          async: false,  
			          cache: false,  
			          contentType: false,  
			          processData: false,  
			          success: function (res) {  
			             console.log(res) ;
			          },  
			          error: function (xhr) {  
			             console.log(xhr);
			             console.log('ajax error')
			          }  
			     });  
			})
		})
	</script>
</body>
</html>